package net.techwatch.gwt.mvp.client.event;

import net.techwatch.gwt.mvp.client.view.MessageDisplayer;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.user.client.ui.DialogBox;

public class SubmitEventHandler implements EventHandler {
	
	private MessageDisplayer msgDisplayer;
	
	public SubmitEventHandler(MessageDisplayer msgDisplayer) {
		this.msgDisplayer = msgDisplayer;
	}

	public void onSubmit(SubmitEvent e) {
		msgDisplayer.getView().getContent().setHTML(e.getMsg());
		((DialogBox) msgDisplayer.getView()).show(); 
	}
}
